<?php


class Admin_Form_Groups extends Zend_Form {

   public function __construct($options = null) {
      parent::__construct($options);
      
      $view = Zend_Layout::getMvcInstance()->getView(); 
      $groupModel = new Model_Group();
      $groupid = $options['params']['id'];
      $group = $groupModel->findOneBy('id', $groupid);
      $this->setName('groupsForm');
      
      $fields = array(
         'id' => new Zend_Form_Element_Text('id', array(
            'label' => $view->translate->_('Id'), 
            'required' => false,
            'value' => $group->id
         )),
         'name' => new Zend_Form_Element_Text('name', array(
            'label' => $view->translate->_('Name'), 
            'required' => true, 
            'value' => $group->name
         )),         
         //'act' => $actList,
         'submit' => new Zend_Form_Element_Submit('login', array(
            'label' => $view->translate->_('Submit')
         ))
      );
     
      
      $this->addElements($fields);
      $this->setMethod('post');
      $this->setAction(Zend_Controller_Front::getInstance()->getBaseUrl(). '/admin/groups/'.$options['params']['action']);

   }



}